//
//  AddressBook.m
//  01-GitHomeWork
//
//  Created by dllo on 16/7/4.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "AddressBook.h"

@implementation AddressBook
-(instancetype)init {
    self = [super init];
    if (self) {
        _mDic = [NSMutableDictionary dictionary];
    }
    
    
    return  self;
}

- (void)addContact:(Contact *)contact {
    
    //取出首字母
    NSString *gruop = contact.groupName;
    NSMutableArray *marr = [self.mDic objectForKey:gruop];
    if (marr == nil) {
        marr = [NSMutableArray array];
        [marr addObject:contact];
        [self.mDic setObject:marr forKey:gruop];
    }
    else {
        [marr addObject:contact];
    }
    
    
    
}








@end
